package com.li.service;

import com.li.mapper.ZhibiaoMapper;
import com.li.pojo.Require;
import com.li.pojo.Zhibiao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ZhibiaoService {

    @Autowired
    ZhibiaoMapper zhibiaoMapper;

    public Zhibiao queryZhibiao(Zhibiao zhibiao){
        return zhibiaoMapper.queryZhibiao(zhibiao);
    }

    public boolean addZhibiao(Zhibiao zhibiao){
        if(zhibiaoMapper.queryZhibiaoByIno(zhibiao)==null){
            zhibiaoMapper.insertZhibiao(zhibiao);
            return  true;
        }
        return false;
    }

    public boolean deleteZhibiao(Zhibiao zhibiao){
        if(zhibiaoMapper.queryZhibiao(zhibiao)!=null){
            zhibiaoMapper.deleteZhibiao(zhibiao);
            return true;
        }
        return false;
    }
    public boolean updateZhibiao(Zhibiao zhibiao){
        zhibiaoMapper.updateZhibiao(zhibiao);
        return  true;
    }
    public List<Zhibiao> allZhibiao(){
        return zhibiaoMapper.listZhibiao();
    }
}
